package com.cskaoyan.catmall.controller.wx;

import com.cskaoyan.catmall.model.vo.BaseRespVo;
import com.cskaoyan.catmall.model.vo.ImageVo;
import com.cskaoyan.catmall.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author: 逍遥子
 * @Date: 2022/01/11/22:51
 * @Description:
 */
@RestController
@RequestMapping("wx/storage")
public class WxStorageController {

    @Autowired
    StorageService storageService;

    @PostMapping("upload")
    public BaseRespVo upload(MultipartFile file){
        ImageVo imageVo = storageService.uploadFile(file);
        return BaseRespVo.ok(imageVo);
    }

}
